package com.spring.lifecycle.config;
 
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class DemoInit3 implements BeanPostProcessor {
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        System.out.println(o+"BeforeInitialization=>"+s);//打印bean初始化前的全类名和名称
        return o;
    }
 
    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        System.out.println(o+"AfterInitialization=>"+s);//打印bean初始化前的全类名和名称
        return o;
    }
}